import tensorflow as tf 

v = tf.Variable([[1.,2.,3.],[4.,5.,6.]])

print(v)
print(v.value())  # to tensor
print(v.numpy())  # to numpy

# assign value  重新赋值 (除Valuable其他tensor都是常量不能重新赋值)
# 用 = 赋值会报错
v.assign(2*v)
print(v.numpy())
v[0,0].assign(0.)
print(v.numpy())
v[1].assign([0.,0.,0.])
print(v.numpy())